package com.u17.controller;

import com.u17.service.OrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 秦川熙
 */
@RestController
@RequestMapping(value = "/orderInfo")
@CrossOrigin
public class OrderInfoController {

    @Autowired
    private OrderInfoService orderInfoService;

    /**
     * 增加订单
     * @param username
     * @param id
     * @param count
     * @return
     */
    @PostMapping(value = "/add")
    public String add(@RequestParam(value = "username") String username, @RequestParam(value = "id") int id, @RequestParam(value = "count") int count) {
        //添加订单
        orderInfoService.add(username, id, count);
        return "success";
    }
}
